<?php 

include '../function.php';

// $str = "学并思官网www.xuebingsiwang.com学并思论坛  http://bbs.xuebingsiwang.com我在学并思的网名叫xuebingsi";

// $preg = "/xuebing(si)/";

// $c = preg_match_all($preg,$str,$reslut);

// var_dump($c);
// var_dump($reslut);
// 
// $str = file_get_contents('https://www.lagou.com/');

// $preg = "/data-lg-tj-cid=\"\d{7}\">(.+)<span>/";

// $preg = "/<a href=\"\/\/www\.lagou\.com\/jobs\/\d{7}\.html\" target=\"_blank\" class=\"position_link fl wordCut\" data-index=\"\d+\" data-lg-tj-id=\"rJ00\" data-lg-tj-no=\"\d{4}\" data-lg-tj-cid=\"\d{7}\">(.+)<span>/";

// <a href="//www.lagou.com/jobs/1805939.html" target="_blank" class="position_link fl wordCut" data-index="5" data-lg-tj-id="rJ00" data-lg-tj-no="0006" data-lg-tj-cid="1805939">web前端<span>[广州]</span></a>


// $c = preg_match_all($preg,$str,$reslut);

// var_dump($c);

// var_dump($reslut);


$str = file_get_contents("http://www.jb51.net/article/31479.htm");



$str = iconv("gb2312", "utf-8//IGNORE",$str); 

// var_dump($str);



$preg = "/<h1 class=\"YaHei\">(.+)<\/h1>/";

// $c = preg_match_all($preg,$str,$reslut);

// var_dump($c);

// var_dump($reslut);



$preg = "/<div id=\"art_demo\">(.+)<\/div>/";

// $c = preg_match_all($preg,$str,$reslut);

// var_dump($c);

// var_dump($reslut);


$preg  = "/<div id=\"content\">(.+)<\/div><!--endmain/s";

// $c = preg_match_all($preg,$str,$reslut);

// var_dump($c);

// var_dump($reslut);

// file_put_contents('./db.php', $reslut[1][0]);


// 18925139194

$str = file_get_contents("https://www.lagou.com/");

$preg  = "/<div class=\"position_main_info\">.*?<span class=\"salary fl\">(.*?)<\/span>.*?<span><!-- <i class=\"experience\"><\/i>&nbsp;  -->(.*?)<\/span> \/ <span>(.*?)<\/span>.*?<\/div>/s";

$c = preg_match_all($preg,$str,$reslut);

var_dump($c);

var_dump($reslut);















 ?>